<?php

/**
 * CondoritoProfesor form base class.
 *
 * @method CondoritoProfesor getObject() Returns the current form's model object
 *
 * @package    condorito
 * @subpackage form
 * @author     Freddy Daniel Garcia
 */
abstract class BaseCondoritoProfesorForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                  => new sfWidgetFormInputHidden(),
      'codigo'              => new sfWidgetFormInputText(),
      'primer_nombre'       => new sfWidgetFormInputText(),
      'primer_apellido'     => new sfWidgetFormInputText(),
      'proyecto_curricular' => new sfWidgetFormInputText(),
      'tipo_identificacion' => new sfWidgetFormInputText(),
      'identificacion'      => new sfWidgetFormInputText(),
      'correo_personal'     => new sfWidgetFormInputText(),
      'id_usuario'          => new sfWidgetFormInputHidden(),
    ));

    $this->setValidators(array(
      'id'                  => new sfValidatorChoice(array('choices' => array($this->getObject()->getId()), 'empty_value' => $this->getObject()->getId(), 'required' => false)),
      'codigo'              => new sfValidatorString(array('max_length' => 255)),
      'primer_nombre'       => new sfValidatorString(array('max_length' => 255)),
      'primer_apellido'     => new sfValidatorString(array('max_length' => 255)),
      'proyecto_curricular' => new sfValidatorString(array('max_length' => 255)),
      'tipo_identificacion' => new sfValidatorString(array('max_length' => 255)),
      'identificacion'      => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
      'correo_personal'     => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'id_usuario'          => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id', 'required' => false)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'CondoritoProfesor', 'column' => array('id_usuario')))
    );

    $this->widgetSchema->setNameFormat('condorito_profesor[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'CondoritoProfesor';
  }


}
